<!-- edit.html文件 -->
<#include "./scripts_purPlan.html">

<style>
	.fream-top-right > ul > li:hover > .margin0 {
		margin: -10px -4px 0px;
	}
	
	.border tbody tr td:nth-child(odd) {
		width: 150px;
	}
	
	.border tbody tr td:nth-child(even) {
		width: 200px;
	}
</style>

<div class="page-content detail-content page-content-main" style="min-height:700px; background-color: #EEF1F6;">
	<form action="" method="post" id="purPlanForm" class="form-horizontal">
		<input type="hidden" name="id" value="${purPlan.id}"/>
		<div class="fh-subtitle">修改采购计划</div>
		<table class="border">
			<tr>
				<td>计划单号</td>
				<td style="position: relative;">
					<input readonly class="form-control-gx" value="${purPlan.planNo}"
						   name="planNo" id="planNo"/>
				</td>
				<td>标题</td>
				<td><input type="text" class="form-control-gx" value="${purPlan.title}"
						   name="title" id="title"></td>
			</tr>
		</table>
		<div style="text-align:center;padding:50px;">
			<span class="model-btn" id="btn_confirm" onclick="submit()">确定</span>
		</div>
	</form>
</div>


<script type="text/javascript">
	
	/**
	 * 更新采购计划。
	 * @param
	 * @return
	 * @author cjw 2020-03-25
	 */
	function submit() {
		if ($("#planNo").val() == "") {
			layer.msg('计划单号不能为空', {
				icon: 2,
				time: 1500
			})
		} else {
			var data = $("#purPlanForm").serialize();
			sys.getApiData("updatePurPlan", data, function (data) {
				
				console.log("data=",data);
				
				if (data.success) {
					js.closeCurrentTabPage(function (contentWindow) {
						contentWindow.reload();
					});
				} else {
					layer.msg(data.message, {
						icon: 2,
						time: 1500
					})
				}
			});
		}
	}

</script>

